﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TSVNAddinUtils
{
	public class ResetAddinCommand : UtilsCommandBase
	{
		private readonly ProcessExecutor _ProcessExecutor;
		private readonly VisualStudioConfig _VisualStudioConfig;

		public ResetAddinCommand(ProcessExecutor processExecutor, VisualStudioConfig visualStudioConfig)
		{
			_ProcessExecutor = processExecutor;
			_VisualStudioConfig = visualStudioConfig;
		}

		protected override void InternalExec(string[] args)
		{
			string ideFullPath = _VisualStudioConfig.GetInstallDir();
			string ideFullFileName = ideFullPath + "devenv.exe";

			string arguments = "/ResetAddin TSVNAddin.VS.Connect /command File.Exit";
			_ProcessExecutor.Exec(ideFullFileName, arguments);
		}
	}
}
